+2001-06-08 Havoc Pennington <hp@redhat.com>
+
+ * gdk-pixbuf-loader.c (gdk_pixbuf_loader_load_module): remove
+ bogus g_return_if_fail
+
+ * io-gif.c (gif_get_lzw): if delay time is 0 or smaller than
+ likely timeout resolution, set it to an arbitrarily-chosen short
+ delay.
+ Fixes bug #55953 from warmenhoven@yahoo.com
+
2001-06-07 Havoc Pennington <hp@redhat.com>
* Makefile.am: use Owen's new way of doing stampfiles/generated
}
else
{
- g_return_val_if_fail (priv->header_buf_offset > 0, 0);
priv->image_module = _gdk_pixbuf_get_module (priv->header_buf,
priv->header_buf_offset,
NULL,
elapsed =
(((iter->current_time.tv_sec - iter->start_time.tv_sec) * G_USEC_PER_SEC +
iter->current_time.tv_usec - iter->start_time.tv_usec)) / 1000;
-
+
if (elapsed < 0) {
/* Try to compensate; probably the system clock
* was set backwards
iter->start_time = iter->current_time;
elapsed = 0;
}
+
+ g_assert (iter->gif_anim->total_time > 0);
/* See how many times we've already played the full animation,
* and subtract time for that.
*/
elapsed = elapsed % iter->gif_anim->total_time;
- g_assert (elapsed < iter->gif_anim->total_time);
-
iter->position = elapsed;
/* Now move to the proper frame */
/* GIF delay is in hundredths, we want thousandths */
context->frame->delay_time = context->gif89.delay_time * 10;
+
+ /* Some GIFs apparently have delay time of 0,
+ * that crashes everything so set it to "fast".
+ * Also, timeouts less than 20 or so just lock up
+ * the app or make the animation choppy, so fix them.
+ */
+ if (context->frame->delay_time < 20)
+ context->frame->delay_time = 20; /* 20 = "fast" */
+
context->frame->elapsed = context->animation->total_time;
- context->animation->total_time += context->frame->delay_time;
+ context->animation->total_time += context->frame->delay_time;
switch (context->gif89.disposal) {
case 0: